Getting an error No "Windows PowerShell Snap-ins are available for version 1"
We are trying to execute exchange power shell command from an application (QFS ) . We get the following error while doing the same. Thebatch fileworks fine when executed from a command prompt , but when called from this application fails with error:Cannot load Windows PowerShell snap-inMicrosoft.Exchange.Management.PowerShell.Admin because of the followingerror:No Windows PowerShell Snap-ins are available for version 1.----- ShellCommand:stdout ----- C:\scripts>Powershell.exe -psconsolefile "C:\ProgramFiles\Microsoft\Exchange Server\Bin\Exshell.psc1" -Command
"Dismount-Database -identity 'almnexchng2k7\First Storage Group\Mailbox
Database' -Confirm:$false"
WARNING: The following errors occurred when loading console C:\Program
Files\Microsoft\Exchange Server\Bin\Exshell.psc1:
Cannot load Windows PowerShell snap-in
Microsoft.Exchange.Management.PowerShell.Admin because of the following
error:
No Windows PowerShell Snap-ins are available for version 1.
----- ShellCommand:stderr -----
Command "Dismount-Database -identity 'almnexchng2k7\First Storage
Group\Mailbox Database' -Confirm:$false" could not be executed because
some Windows PowerShell snap-ins did not load.
----- ShellCommand:stdout -----
April 24th, 2009 4:48pm
MIght be because you are running it from the 32-bit powershell console.MCSE: MCITP - Exchange Admin: MCTS - SQL 2005
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2009 6:10pm
How can i verify that i am running it from a 32 bit powershell console. The OS in this case is Win2003 64 bit and application used is Exchange2007. As i have informed , the command executes successfully when executed from the command prompt , but fails when called from within an application.
April 27th, 2009 10:53am
If you try to load it into the 32-bit Powershell.exe, you get the error message above. Likewise, if you are automating Powershell from an application it must be compiled for 64-bit in order to load the Exchange Management Shell snap-in
----------Refer to <No Windows PowerShell Snap-ins are available for version 1 when Loading Exchange Powershell Snap-in>
Is the QFS 32-bit version? If its true, the calls will be redirected to 32-bit powershell and that causes the error
Workaround:
Please use a 64-bit QFS
Please try to use Hotfix 942589
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2009 11:52am